import {getRequest, postRequest} from "@/utils/request.js";

export async function getCheckCode(email){
    try {
        return await getRequest("/heaven-server/register/get-checkcode", {email});
    }catch (e) {
        console.log('获取验证码失败',e);
        return {code: -1, msg: `获取验证码失败-${e.message}`}
    }
}

export async function registerVerify(nickname, email, pwd, repwd, checkCode){
    try {
        return await postRequest("/heaven-server/register/verify-checkcode", {nickname, email, pwd, repwd, checkCode});
    } catch (e) {
        console.log('注册失败',e);
        return {code: -1, msg: `注册失败-${e.message}`}
    }
}